﻿using FireStarterModeller.BO;
using Habanero.Testability;

namespace FireStarterModeller.Test.BO
{
    public class TestUtilsUIView
    {
        public static BOTestFactory<UIView> GetFactory()
        {
            return BOTestFactoryRegistry.Instance.Resolve<UIView>();
        }
        /// <summary>
        /// Creates a new saved UIView with a random value assigned to every property
        /// </summary>
        public static UIView CreateSavedUIView()
        {
            UIView uIView = CreateUnsavedValidUIView();
            uIView.Save();
            return uIView;
        }

        /// <summary>
        /// Creates a new unsaved UIView with a random value assigned to every property
        /// </summary>
        public static UIView CreateUnsavedValidUIView()
        {
            UIView uIView = new UIView();
            uIView.ViewName = TestUtilsShared.GetRandomString();
            uIView.Generated = TestUtilsShared.GetRandomBoolean();
            uIView.ClassID = TestUtilsShared.CreateSavedDMClass().ClassID;
            return uIView;
        }
	    
        /// <summary>
        /// Creates a new unsaved UIView where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static UIView CreateUnsavedDefaultUIView()
        {
            UIView uIView = new UIView();
            return uIView;
        }
    }
}